home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / MSDOS / (m)aaj / LPTX.DOC < prev    next >
Text File  |  1979-12-31  |  5KB  |  137 lines

  1.  
  2. LPTx : Line Printer Output Capture Routine
  3.  
  4. -------------------------------------------------------------
  5.  
  6.  Version 3.0
  7.  
  8.  (C)    Copyright 1985 by Mark DiVecchio, All Rights Reserved
  9.  
  10.  You may use and freely distribute this program for
  11.  non-commercial applications.
  12.  
  13.  Mark C. DiVecchio
  14.  9067 Hillery Drive
  15.  San Diego, CA 92126
  16.  619-566-6810
  17. -------------------------------------------------------------
  18.  
  19.     Have you ever wanted to get some data from your screen into a
  20. program? Have you ever wanted to grab onto some printer data and put it into
  21. a disk file but the program you are using does not have that as a option?
  22. Well here is the answer to your problem. This program will grab onto
  23. anything sent out of a line printer port as long as the program uses the
  24. standard BIOS INT 17h call. I have tried this with printscreen, with
  25. printscreen in graphics mode (produces some mighty unusual output),  with
  26. SIDEWAYS, with the copy command to LPT1: etc, with my word processor
  27. (FinalWord), with MASM (direct output to LPT1) with Wordstar, with 1-2-3 and
  28. with the DOS '>' redirection command line option. It all seems to work.
  29.  
  30.     This program intercepts the BIOS interrupt 17, the line printer
  31. interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
  32. file. All three redirections may be active at the same time.
  33.  
  34.     LPTx requires DOS 2.0 or later.
  35.  
  36. Calling sequence:
  37. lptx -1 -o <d:[pathname]filename>
  38.  
  39. where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
  40.      LPT3
  41.      This option must appear first
  42.  
  43.       -o means start the redirection to file specified. If redirection
  44.          is already in progress for the selected line printer,
  45.      the old file will be closed first.
  46.      (If you do not specify -o but you do specify a line printer,
  47.      LPTx will use either the last file name that you gave when
  48.      you loaded LPTx or will use the file named LPTXy.LST which it
  49.      will create in the root directory on the default drive - where
  50.      y is 1, 2, or 3.)
  51.  
  52.      It is not necessary that you specify the complete path name
  53.      for the file. LPTx will create the file in the default 
  54.      directory if you don't specify a directory. LPTx will always
  55.      be able to find the file because it saves the complete path.
  56.  
  57.     -c means close the file and send all further output directly to the
  58.      line printer.
  59.  
  60. If neither option is specified, LPTx just displays the program status.
  61.  
  62. note: -1, -2, and -3 are mutually exclusive
  63.       -o and -c are mutually exclusive
  64.  
  65. examples:
  66.  
  67. lptx                Displays the program status
  68.  
  69. lptx ?                Displays a HELP screen
  70.  
  71. lptx -1                redirects LPT1 output to file named
  72.                 LPTX1.LST in the root directory
  73.                 on the default drive or the last
  74.                 named file.
  75.  
  76. lptx -o a:\able.xxx        redirects LPT1 output to file named
  77.     or            a:\able.xxx. Any open redirection
  78. lptx a:\able.xxx        disk file for LPT1 is closed.
  79.  
  80. lptx -2 b:xx.lst        redirects LPT2 output to file named
  81.                 XX.LST in the default directory
  82.                 on drive B:. Any open redirection
  83.                 disk file for LPT2 is closed.
  84.  
  85. lptx -3 d:\ab\cd\file.lst    redirects LPT3 output to the file named
  86.                 file.lst in the directory ab\cd on drive
  87.                 d:.
  88.  
  89. lptx -c                closes any disk files open for LPT1 and sends
  90.     or            the output back to the line printer
  91. lptx -1 -c            If no redirection is taking place to LPT1,
  92.                 this is    a NOP. LPT2 and LPT3 are not
  93.                 affected.
  94.  
  95. lptx -2 -c            closes any disk file open for LPT2 and
  96.                 sends the output back to line printer.
  97.                 if no redirection is taking place to LPT2,
  98.                 this is a NOP. LPT1 and LPT3 are not
  99.                 affected.
  100.  
  101.     By redirecting LPT2 or LPT3 to a disk file, you can in effect have 2
  102. or 3 printers on your system. LPT1 can be your physical printer and you can
  103. have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1 works
  104. normally.
  105.  
  106.     If you are redirecting to a diskette file, do not remove the diskette
  107. once the redirection starts. I recommend redirecting to a hard disk or a RAM
  108. disk.
  109.  
  110.     If LPTx encounters any kind of error during the redirection, it
  111. terminates operation and sends output back to the line printer. It does not
  112. display anything but beeps the speaker four times. This prevents your
  113. currently running program from possibly getting destroyed. An error with
  114. LPT1 redirection does not shut down LPT2 or LPT3 redirection.
  115.  
  116.     LPTx captures the int 17h interrupt vector. Problems may occur with
  117. print spoolers which also take over the int 17h  vector. You can be sure that
  118. LPTX works correctly by running LPTX after you have run your print spooler.
  119. LPTX will be transparent to the print spooler but your print spooler may not
  120. be transparent to LPTX. LPTX works fine with IBM's PRINT command.
  121.  
  122.     LPTx also captures the int 24h critical error interrupt vector. This
  123. is done only for the period that LPTx is using the disk. This prevents the
  124. generation of funny error messages in the middle of other programs that you
  125. may be running. (LPTx just beeps 4 times and clears itself out of way if a
  126. disk error occurs).
  127.  
  128.     This version of LPTx can redirect all three printers to three
  129. different files with all 3 active at the same time.
  130.  
  131.     LPTx uses about 7K of memory for the resident data buffers and
  132. interrupt handler.
  133.  
  134.     If you modify or find any bugs in this program, I would appreciate
  135. it if you would drop me a line with the changes. Use the address above. 
  136.  
  137.